<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>


  <script>
    let balance = 0
    while (true) {
      let operator = +prompt(`
        请输入你的操作：
            1：取款
            2：存款
            3：查看余额
            4：退出
      `)

      if (operator === 4) {
        break;
      }

      let money
      switch (operator) {
        case 1:
          money = +prompt('请输入取款金额')
          if (money > balance) {
            alert('您的余额不足')
          } else {
            balance -= money
          }
          break;
        case 2:
          money = +prompt('请输入存款金额')
          balance += money
          break;
        case 3:
          alert(`您当前的余额为${balance}`)
          break;
        default:
          alert('请输入正确的操作')
      }
    }
  </script>
</body>

</html>